// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
// import VueI18n from 'vue-i18n'; //  多语言依赖
import i18n from './lang';  // 国际化
import store from './store';  //  引入vuex
import iView from 'iview'; // 引入iview-ui框架
import 'iview/dist/styles/iview.css'; //  css样式
import 'babel-polyfill'; //  兼容
require('common/css/reset.css');  //  样式重置
require('./mock.js'); //  数据模拟
require('echarts/theme/dark');
Vue.use(iView, {
  i18n: (key, value) => i18n.t(key, value)
}); //  全局引用
Vue.config.productionTip = false;   //  生产提示
// 页面进入加载progress
router.beforeEach((to, from, next) => {
  iView.LoadingBar.start();
  next();
});
//  页面离开progress
router.afterEach((route) => {
  iView.LoadingBar.finish();
});
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  template: '<App/>',
  components: { App }
});
